<?php
/**
 * Created by PhpStorm.
 * User: R.Ice
 * Date: 2019/2/20
 * Time: 14:50
 * name:获取试听人数
 * url:/erpStudent/numberOfAudition
 */

$oesid = $route->bodyParams['oesid'];
$start = $route->bodyParams['start'];
$end = $route->bodyParams['end'];

$sql = "SELECT `ocs_osid` FROM `art_oa_class_student` AS ocs LEFT JOIN `art_oa_student` AS os ON ocs.`ocs_osid` = os.`os_id` WHERE `os_oesid` = $oesid AND ocs.is_delete = 0 AND `ocs_type` = 1 AND `ocs_create_time` BETWEEN  $start AND $end  GROUP BY `ocs_osid`";

$re=$db->mysqlDB->query($sql);

$rs = array("data" => $re,"sql" => $sql);
////返回成功结果
$response->responseData(true, $rs);